<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\HouseController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

/* Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});
 */

//非登录接口   --ip 黑名单 ->middleware(['api.statistics', 'check.ip.blacklist'])
// ->middleware(['check.ip.blacklist'])
Route::namespace('Http')->group(function () {
    #redis 测试
    Route::get('testRedis', [App\Http\Controllers\TestController::class, 'testRedis']);
    // 获取今日API统计信息
    Route::get('today', [App\Http\Controllers\TestController::class, 'getTodayStats']);
    
    // 获取指定日期的API统计信息
    // 参数: date - 日期格式 YYYY-MM-DD，例如：2025-09-29
    Route::get('date', [App\Http\Controllers\TestController::class, 'getDateStats']);
    
    // 获取当前小时的API统计信息
    Route::get('current_hour', [App\Http\Controllers\TestController::class, 'getCurrentHourStats']);
    
    // 获取指定小时的API统计信息
    // 参数: hour - 小时格式 YYYY-MM-DD-HH，例如：2025-09-29-14
    Route::get('hour', [App\Http\Controllers\TestController::class, 'getHourStats']);
    
    // 获取IP统计信息
    // 查询参数:
    //   - ip: 要查询的IP地址（可选，默认为当前请求IP）
    //   - date: 查询日期，格式 YYYY-MM-DD（可选，默认为今天）
    Route::get('ip', [App\Http\Controllers\TestController::class, 'getIpStats']);
    
    // 获取统计概览（包含今日、昨日和当前小时的数据对比）
    Route::get('overview', [App\Http\Controllers\TestController::class, 'getStatsOverview']);


    #豆瓣推送消息-douban_post
    Route::post('douPush', [App\Http\Controllers\DoubanpostController::class, 'addData']);
    #微博推送消息-weibo_post
    Route::post('weiboPush', [App\Http\Controllers\WeibopostController::class, 'addData']);
    #爆料推送消息-baoliao_post
    Route::post('baoliaoPush', [App\Http\Controllers\BaoliaopostController::class, 'addData']);
    #爆料推送消息-baoliao_post_bak
    Route::post('baoliaoPushbak', [App\Http\Controllers\BaoliaopostController::class, 'baoliaoPushbak']);

    #爆料分类列表
    Route::post('baoliaoCategorylist', [App\Http\Controllers\BaoliaopostController::class, 'baoliaoCategoryList']);
    Route::post('baoliaoCategorylist2', [App\Http\Controllers\BaoliaopostController::class, 'baoliaoCategoryList2']);
    #爆料推送接口-
    # 分类映射-推送接口
    Route::post('brandmapping', [App\Http\Controllers\BrandmappingController::class, 'addData']);
    # 品牌映射-推送接口
    Route::post('categorymapping', [App\Http\Controllers\CategorymappingController::class, 'addData']);
    #分类-列表
    Route::post('paramlist', [App\Http\Controllers\CategorymappingController::class, 'paramList']);
    #错误信息写入日志
    Route::post('logerror', [App\Http\Controllers\BaoliaopostController::class, 'addDataLog']);

    #逛逛-列表
    Route::post('douList', [App\Http\Controllers\GuangguangController::class, 'getList']);
    #逛逛-详情
    Route::post('douDetail', [App\Http\Controllers\GuangguangController::class, 'dataDetail']);


    #监控-前端-豆瓣-列表
    Route::post('douJKList', [App\Http\Controllers\JiankongController::class, 'getList']);
    #监控-前端-豆瓣-详情
    Route::post('douJKDetail', [App\Http\Controllers\JiankongController::class, 'dataDetail']);

    #监控-前端-豆瓣-喜欢列表
    Route::post('douJLikeList', [App\Http\Controllers\DoubanlikeController::class, 'getList']);
    #豆瓣喜欢-删除
    Route::post('douJLikedel', [App\Http\Controllers\DoubanlikeController::class, 'del']);

    #前端-豆瓣-喜欢
    Route::post('douLike', [App\Http\Controllers\DoubanlikeController::class, 'addDate']);


    #前端-豆瓣-收藏
    Route::post('doucollect', [App\Http\Controllers\DoubancollectController::class, 'addDate']);
    #前端-豆瓣-收藏-列表
    Route::post('douJcollectlist', [App\Http\Controllers\DoubancollectController::class, 'getList']);
    #前端-豆瓣-收藏-删除
    Route::post('douJcollectdel', [App\Http\Controllers\DoubancollectController::class, 'del']);

    //回复
    Route::post('comments1', [App\Http\Controllers\CommentController::class, 'addDate1']);
    Route::post('comments2', [App\Http\Controllers\CommentController::class, 'addDate2']);
    // 暂时先不用
    Route::post('commentsList', [App\Http\Controllers\CommentController::class, 'getList']);
    //评论一级列表
    Route::post('commentsList1', [App\Http\Controllers\CommentController::class, 'getList1']);
    //评论子评论
    Route::post('commentsList2', [App\Http\Controllers\CommentController::class, 'getList2']);

    #统计某个帖子的总数
    Route::post('totalComments', [App\Http\Controllers\CommentController::class, 'totalComments']);

    ##########统计评论区的点赞和踩的数量#################

    Route::post('commentvoteadd', [App\Http\Controllers\CommentvoteController::class, 'commentvoteadd']);

    ##########统计评论区的点赞和踩的数量#################
    ##########评论区违法举报#################
    Route::post('commentreportadd', [App\Http\Controllers\CommentreportController::class, 'commentreportadd']);
    Route::post('commentreportedit', [App\Http\Controllers\CommentreportController::class, 'commentreportedit']);
    Route::post('commentreportlist', [App\Http\Controllers\CommentreportController::class, 'commentreportlist']);
    ##########评论区违法举报#################
    ###########举报评论区类型列表############
    Route::post('commentreportconfiglist', [App\Http\Controllers\ReporttypeconfigController::class, 'commentreportconfiglist']);
    ###########举报评论区类型列表############

    ##################浏览记录##########################################
    //历史记录列表
    Route::post('historyList', [App\Http\Controllers\ViewcountController::class, 'getList']);
    //历史记录删除
    Route::post('delhistory', [App\Http\Controllers\ViewcountController::class, 'del']);
    ##################浏览记录##########################################

    //监控-微博线报-用户标签
    Route::post('weibolableList', [App\Http\Controllers\JiankongController::class, 'getwbLableList']);
    //监控-微博线报
    Route::post('weiboList', [App\Http\Controllers\JiankongController::class, 'getwbList']);
    //我的帖子-添加帖子(app 用户)
    Route::post('addAppData', [App\Http\Controllers\DoubanpostController::class, 'addAppData']);
    //我的帖子-列表(app用户)
    Route::post('appDatalist', [App\Http\Controllers\DoubanpostController::class, 'getListAppData']);
    //我的帖子删除-自己删除自己帖子
    Route::post('appDatadel', [App\Http\Controllers\DoubanpostController::class, 'appDatadel']);
    //我的帖子-删除-管理员
    Route::post('officialDatadel', [App\Http\Controllers\DoubanpostController::class, 'officialDatadel']);
    //我的帖子-消息通知-违规通知-列表
    Route::post('cardmsglist', [App\Http\Controllers\AdmindeletelogController::class, 'getList']);
    //爆料帖子-管理员删除
    Route::post('baoliaoAdminDate', [App\Http\Controllers\AdmindeletelogController::class, 'addAdminDate']);
    

    //我的帖子-修改(app用户)
    Route::post('editAppData', [App\Http\Controllers\DoubanpostController::class, 'editAppData']);
    //我的帖子-详情(app用户)
    Route::post('appDatadetail', [App\Http\Controllers\DoubanpostController::class, 'appDatadetail']);

    #############################爆料#################################
    //识别口令信息获取用户详情
    Route::post('baoliao1', [App\Http\Controllers\BaoliaoController::class, 'addData1']);
    //爆料列表
    Route::post('baoliaolist', [App\Http\Controllers\BaoliaoController::class, 'getList']);
    //爆料详情
    Route::post('baoliaoDetail', [App\Http\Controllers\BaoliaoController::class, 'dataDetail']);
    
    //爆料详情-方案
    Route::post('baoliaoDetailfangan', [App\Http\Controllers\BaoliaoController::class, 'dataDetailfangan']);
    //方案详情
    Route::post('baoliaoDetailfangandefault', [App\Http\Controllers\BaoliaoController::class, 'baoliaoDetailfangandefault']);

    ############################我的喜欢##############################
    //爆料喜欢
    Route::post('baoliaoLike', [App\Http\Controllers\BaoliaolikeController::class, 'addDate']);
    //爆料喜欢-列表
    Route::post('baoliaoLikelist', [App\Http\Controllers\BaoliaolikeController::class, 'getList']);
    //爆料喜欢-删除
    Route::post('baoliaoLikedel', [App\Http\Controllers\BaoliaolikeController::class, 'del']);
    ############################我的喜欢##############################

    ###########################爆料产品分类######################
    Route::post('productcategoryparentlist', [App\Http\Controllers\ProductcategoryparentController::class, 'getList']);
    Route::post('productcategoryparentlist2', [App\Http\Controllers\ProductcategoryparentController::class, 'getList2']);
    ###########################爆料产品分类######################

    ###########################爆料收藏#################################

    //爆料收藏
    Route::post('baoliaoCollect', [App\Http\Controllers\BaoliaocollectController::class, 'addDate']);
    //爆料收藏-列表
    Route::post('baoliaocollectlist', [App\Http\Controllers\BaoliaocollectController::class, 'getList']);
    //爆料收藏-删除
    Route::post('baoliaocollectdel', [App\Http\Controllers\BaoliaocollectController::class, 'del']);

    ###########################爆料收藏#################################


    //完善爆料信息
    Route::post('baoliao2', [App\Http\Controllers\BaoliaoController::class, 'perfectInfo']);
    //爆料信息上传-机器人
    Route::post('baoliao3', [App\Http\Controllers\BaoliaoController::class, 'perfectInfo3']);



    #############################爆料#################################

    #############################分类#################################
    Route::post('categorylist', [App\Http\Controllers\CategoryController::class, 'getList']);

    #################################用户#################################
    Route::post('isUserOfficial', [App\Http\Controllers\UserController::class, 'isUserOfficial']);
    
    #################################用户#################################

    #################################内容举报##################################
    Route::post('reportadd', [App\Http\Controllers\UserreportController::class, 'addData']);

    Route::post('reportdel', [App\Http\Controllers\UserreportController::class, 'del']);

    Route::post('reportlist', [App\Http\Controllers\UserreportController::class, 'getList']);
    
    #################################内容举报##################################

    #################################产品分类####################################
    Route::post('productcategorylist', [App\Http\Controllers\ProductcategoryController::class, 'getList']);

    Route::post('productcategorylist2', [App\Http\Controllers\ProductcategoryController::class, 'getList2']);
    #################################产品分类####################################




    #################################搜索框历史记录############################
    Route::post('searchhistorylist', [App\Http\Controllers\SearchhistoryController::class, 'getList']);
    Route::post('searchhistoryadd', [App\Http\Controllers\SearchhistoryController::class, 'addDate']);
    Route::post('searchhistorydel', [App\Http\Controllers\SearchhistoryController::class, 'del']);
    #################################搜索框历史记录############################

    #################################订单###################################
    //获取订单
    Route::post('orderlist', [App\Http\Controllers\OrderController::class, 'getList']);

    Route::get('/taobao/orders/fetch', [App\Http\Controllers\TaobaoOrderController::class, 'fetchOrders']);
    Route::post('/taobao/orders/fetch-next', [App\Http\Controllers\TaobaoOrderController::class, 'fetchNextPage']);

    // 第一步：生成授权URL
    Route::get('/taobao/auth', [TaobaoAuthController::class, 'redirectToAuth']);

    // 第二步：处理回调
    Route::get('/taobao/callback', [TaobaoAuthController::class, 'handleCallback']);
    #################################订单###################################

    ################################全站搜索################################
    Route::post('searchlist', [App\Http\Controllers\SearchController::class, 'getList']);
    Route::post('searchdetail', [App\Http\Controllers\SearchController::class, 'dataDetail']);
    ################################全站搜索################################


    ################################用户关注####################################
    Route::post('followadd', [App\Http\Controllers\UserFollowController::class, 'addDate']);
    Route::post('followlist', [App\Http\Controllers\UserFollowController::class, 'getList']);


    ################################用户关注####################################

    ################################作品关注####################################
    Route::post('followworkadd', [App\Http\Controllers\UserworkfollowsController::class, 'addDate']);
    Route::post('followworklist', [App\Http\Controllers\UserworkfollowsController::class, 'getList']);


    ################################作品关注####################################



    ###########################值得买链接解析#######################################
    Route::post('SmzdmLianJieJieXi', [App\Http\Controllers\PythonController::class, 'SmzdmLianJieJieXi']);
    Route::post('getmoneyrate', [App\Http\Controllers\PythonController::class, 'getMoneyRate']);
    Route::post('categorybrand', [App\Http\Controllers\PythonController::class, 'categoryBrand']);
    Route::post('getgoodsdetail', [App\Http\Controllers\PythonController::class, 'get_goods_detail']);


    Route::post('fetchurlgoodsdetail', [App\Http\Controllers\PythonController::class, 'fetch_url_goods_detail']);
    ###########################值得买链接解析#######################################



    Route::get('latest', [App\Http\Controllers\BaoLiaoqueryController::class, 'getLatest']);
    Route::get('hottest', [App\Http\Controllers\BaoLiaoqueryController::class, 'getHottest']);
    Route::get('mixed', [App\Http\Controllers\BaoLiaoqueryController::class, 'getMixed']);
    Route::get('search', [App\Http\Controllers\BaoLiaoqueryController::class, 'search']);

    #####################关注###########################
    Route::post('eachfocuslist', [App\Http\Controllers\MsgController::class, 'eachfocusList']);
    Route::post('usertoother', [App\Http\Controllers\MsgController::class, 'userToOther']);

    Route::post('myfans', [App\Http\Controllers\MsgController::class, 'myFans']);
    
    Route::post('allMsg', [App\Http\Controllers\MsgController::class, 'allMsg']);
    Route::post('centerNum', [App\Http\Controllers\MsgController::class, 'centerNum']);

    #####################关注###########################


    ######### 帮助函数###########
    Route::post('getIp', [App\Http\Controllers\HelpersController::class, 'getIp']);
    ######### 帮助函数###########

    ######## 根据ip 获取区域地址#######
    Route::post('queryIp', [App\Http\Controllers\IpController::class, 'queryIp']);
    ######## 根据ip 获取区域地址#######

    ###微博接收参数####
    Route::post('weiboadd', [App\Http\Controllers\WeiboController::class, 'addData']);


    
});
//爆料信息上传-机器人


//验证接口
Route::group(['middleware' => ['request']], function ()
{
    //Route::post('houselist', [App\Http\Controllers\HouseController::class, 'getList']);

});



Route::group([
    'namespace'  => 'App\Log\Controllers',
    /*'prefix'     => config('log-viewer.web_route'),
    'middleware' => config('log-viewer.web_middleware', 'web'),*/
], function () {
    Route::get('loglist', 'HomeController@home')->name('log-viewer-home');
    Route::get('logdownload', 'HomeController@download')->name('log-viewer-download');
    Route::get('logdelete', 'HomeController@delete')->name('log-viewer-delete');
    Route::get('logddcontent', 'HomeController@ddcontent')->name('log-viewer-ddcontent');

    Route::get('list', 'ApplogsController@home')->name('applogs-viewer-home');
    Route::get('realtime', 'ApplogsController@viewindex')->name('realtime-viewer-home');

    Route::get('index', [App\Log\Controllers\ApplogsController::class, 'index']);


});









//http://127.0.0.1:88/xingfan/public/index.php/api/realtime
//http://127.0.0.1:88/xingfan/public/index.php/api/loglist

//http://127.0.0.1:88/xingfan/public/index.php/api/list
//http://127.0.0.1:88/xingfan/public/index.php/api/index

// https://xf-162.lottefuture.com/api/loglist

//https://xf-162.lottefuture.com/api/list
